package com.fs.common.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fs.common.annotation.ColumnDesc;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.beanutils.PropertyUtils;

/**
 * @author ACE
 * @desc 菜单动作配置实体类
 * @creationTime 2019-03-30 15:00
 * @projectName weixinframe
 * @packageName com.fs.pojo
 */
@Data
@AllArgsConstructor
@TableName("s_menu_motion")
@EqualsAndHashCode(callSuper=false)
public class MenuMotion extends IdEntity{
	@ColumnDesc(name = "动作编码")
	private String motionCode;

	@ColumnDesc(name = "动作名称")
	private String motionName;

	@ColumnDesc(name = "动作图标")
	private String motionIcon;

	@ColumnDesc(name = "动作排序")
	private Integer motionOrder = 0 ;

	@ColumnDesc(name = "菜单ID")
	private String menuId;

	@ColumnDesc(name = "动作ID")
	private String motionId;

	public MenuMotion() {
	}

	public MenuMotion(String menuId, Motion motion){
		this.menuId = menuId;
		this.motionId = motion.getId();
		try {
			PropertyUtils.copyProperties(this,motion);
			this.setId(null);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
